/**
 * 
 */
package com.orange.cepmanager.android.gcm;

import com.orange.cepmanager.android.esper.CEPManager;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

import static com.orange.cepmanager.android.CEPManagerCommon.*;

/**
 * Command to control CEP engine 
 * @author Fairouz OUBENALI
 *
 */
public class GCMMessageCommand {
	private Context mContext;
	private CommandCEP mCommand;

	public GCMMessageCommand(Context contex,CommandCEP cmd ) {
		this.mContext=contex;
		this.mCommand=cmd;
	}
	
	public void executeCommandCEP()
 {
		Log.i(GCM_MESSAGE_COMMAND_TAG, " GCM : command cep lunched");
		if (mCommand.equals(CommandCEP.startCEPEngine)) {
			CEPManager.start();
			Log.i(GCM_MESSAGE_COMMAND_TAG,
					" GCM : command cep lunched successufly");
//			Toast.makeText(mContext, "GCM : command cep lunched successufly ",
//					Toast.LENGTH_LONG).show();
		} else if (mCommand.equals(CommandCEP.stopCEPEngine)) {
			CEPManager.stop();
			Log.i(GCM_MESSAGE_COMMAND_TAG,
					" GCM : command cep stoped successufly");
//			Toast.makeText(mContext, "GCM : command cep stoped successufly",
//					Toast.LENGTH_LONG).show();
		}
	}
	

}
